/*
 * trdp_mini_config.h
 *
 *  Created on: zhangyu
 *      Author: ZhangYu @ DL-LaiKe
 */

#ifndef CONFIG_TRDP_MINI_CONFIG_H_
#define CONFIG_TRDP_MINI_CONFIG_H_

/***********************************************************************************************************************
 * INCLUDES
 */

#ifdef __cplusplus
extern "C" {
#endif


/***********************************************************************************************************************
 * DEFINES
 */
#define TRDP_MINI_PROTOCOL_VER  	(0x0100)                /** high 8 bits: version number, low 8 bits: publish number  */

#define TRDP_MINI_USE_BIG_ENDIAN	(1)						/* 0-> communication with small endian  1-> communication with big endian*/

/** Static Memory Define*/
/** We internally allocate memory always by these block sizes. The largest available block is 1348 Bytes for some TCP/IP stack can't break the packages*/
#define TRDP_MINI_NBK_SIZES			(8)			/*<< No of pre-defined block sizes */
#define TRDP_MINI_MEM_BLKSIZE  		{16, 32, 64, 128, 256, 512, 1024, 1348}
#define TRDP_MINI_BLKCNT_16B		(0)			/* the count of memory block size = 16 bytes*/
#define	TRDP_MINI_BLKCNT_32B		(0)			/* the count of memory block size = 32 bytes*/
#define	TRDP_MINI_BLKCNT_64B		(0)			/* the count of memory block size = 64 bytes*/
#define	TRDP_MINI_BLKCNT_128B		(0)			/* the count of memory block size = 128 bytes*/
#define	TRDP_MINI_BLKCNT_256B		(0)			/* the count of memory block size = 256 bytes*/
#define	TRDP_MINI_BLKCNT_512B		(4)			/* the count of memory block size = 512 bytes*/
#define	TRDP_MINI_BLKCNT_1024B		(2)			/* the count of memory block size = 1024 bytes*/
#define	TRDP_MINI_BLKCNT_1348B		(4)			/* the count of memory block size = 1348 bytes*/

/** PD and MD package control block number*/
/*
 * the max number of PD control block should at least more than the real process data's comId number * 2 of this device
 * include request comId and subscribe comId
 * */
#define TRDP_MINI_PD_CTRL_MAX_NUM	(32)
/*
 * the max number of MD control block should at least more than the real process data's comId number * 2 of this device
 * */
#define TRDP_MINI_MD_CTRL_MAX_NUM	(2)

/** Message Queues*/
#define	TRDP_MINI_PD_Q_LEN			(32)		/* the length of stack send PD package Queue*/
#define TRDP_MINI_MD_Q_LEN			(2)			/* the length of stack send MD package Queue*/

/** PROTOCOL Port Defines*/
#ifndef TRDP_MINI_PD_UDP_PORT
#define TRDP_MINI_PD_UDP_PORT  		17224           /**< process data UDP port    */
#endif

#ifndef TRDP_MINI_MD_UDP_PORT
#define TRDP_MINI_MD_UDP_PORT  		17224          /**< message data UDP port  not use yet!!!! for user can use PD's unicast to complete this function   */
#endif

#ifndef TRDP_MINI_MD_TCP_PORT
#define TRDP_MINI_MD_TCP_PORT  		20550           /**< message data TCP port     */
#endif

#ifndef TRDP_MINI_TOPO_CTRL_PORT
#define TRDP_MINI_TOPO_CTRL_PORT    20560      /**< message data for ETB switch topo manager    */
#endif

#ifdef __cplusplus
}
#endif

#endif /* CONFIG_TRDP_MINI_CONFIG_H_ */
